home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / MODE.DOC < prev    next >
Text File  |  1995-09-20  |  16KB  |  440 lines

  1.  
  2. ****************************  VIDEO MODES  ***********************************
  3.  
  4. ASM32 video mode subroutines (C) Copyright 1993 Douglas Herr
  5. All rights reserved
  6.  
  7. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  8.  
  9. HGRAPH:      establishes Hercules graphics mode, pages 0 & 1
  10. HGRAPH0:     establishes Hercules graphics mode, clear page 0 only
  11. Source:      hgraph.asm ($herc.asm, $hmode.asm)
  12.  
  13. Hercules or compatible required
  14. (including Hercules InColor)
  15.  
  16. Call with:   no parameters
  17. Returns:     if CF = 1, no Hercules installed
  18.              if CF = 0, AX = code for Hercules model
  19.              128 = HGC
  20.              144 = HGC+
  21.              208 = InC
  22. Uses:        AX, ECX, CF
  23. Supports:    Hercules graphics cards and compatibles: graphics mode
  24.              see also Use64k in SYSTEM.DOC
  25. Example:     call    hgraph      ; establish graphics mode
  26.              jc      no_hercules ; drat!
  27.  
  28.  
  29. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  30.  
  31. HRAM8029:    establish an 80-column, 29-row RamFont mode, loading a
  32.              standard 8x12 character font in RAM
  33. Source:      hram8029.asm ($herc.asm, $hmode.asm, $h8x12.asm, f8x12rle.asm,
  34.                            $rld.asm)
  35.  
  36. HRAM8043:    establish an 80-column, 43-row RamFont mode, loading a
  37.              standard 8x8 character font in RAM
  38. Source:      hram8043.asm ($herc.asm, $hmode.asm, $h8x8.asm, f8x8.asm)
  39.  
  40. HRAM9025:    establish a 90-column, 25-row RamFont mode using
  41.              standard ROM characters
  42. Source:      hram9025.asm ($herc.asm, $hmode.asm)
  43.  
  44. HRAM9029:    establish a 90-column, 29-row RamFont mode, loading a
  45.              standard 8x12 character font in RAM
  46. Source:      hram9029.asm ($herc.asm, $hmode.asm, $h8x12.asm, f8x12lre.asm,
  47.                            $rld.asm)
  48.  
  49. HRAM9043:    establish a 90-column, 43-row RamFont mode, loading a
  50.              standard 8x8 character font in RAM
  51. Source:      hram9043.asm ($herc.asm, $hmode.asm, $h8x8.asm, f8x8.asm)
  52.  
  53. Hercules RamFont card required
  54. (including Hercules InColor)
  55.  
  56. Note:        use htext to restore normal 80 x 25 text mode
  57.  
  58. Call with:   no parameters
  59. Returns:     if CF = 1, no RamFont card installed
  60.              if CF = 0, AX = code for Hercules model
  61.              144 = HGC+
  62.              208 = InC
  63. Uses:        AX, CF; all other flags and registers are saved
  64. Supports:    HGC+ and InC cards: 4k RamFont mode
  65. Example:     call  hram8043      ; RamFont mode: 80x43
  66.              jc    no_ramfont    ; drat!
  67.  
  68.  
  69. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  70.  
  71. HTEXT:       establish (or restore) Hercules text mode
  72. Source:      htext.asm ($herc, $hmode)
  73.  
  74. Call with:   no parameters
  75. Returns:     if CF = 1, no Hercules installed
  76.              if CF = 0, AX = code for Hercules model
  77.              128 = HGC
  78.              144 = HGC+
  79.              208 = InC
  80. Uses:        AX, CF
  81. Supports:    Hercules graphics cards and compatibles: text mode
  82.              (including Hercules InColor)
  83. Example:     call  htext         ; Hercules text mode
  84.              jc    no_herc       ; drat!
  85.  
  86.  
  87. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  88.  
  89. TOCOLOR:     switches system to color text mode; may be used to switch
  90.              monitors on a 2-monitor system, or to switch to the standard
  91.              80-column, 25-rows color mode from other color modes
  92. Source:      tocolor.asm ($6845.asm)
  93.  
  94. Call with:   no parameters
  95. Returns:     CF = 1 if no color monitor
  96.              CF = 0 if successful
  97. Uses:        CF; all registers and all other flags are saved
  98. Example:
  99.  
  100. extrn   tocolor:near
  101.  
  102. include codeseg.inc
  103.  
  104.         .
  105.         .
  106.         .
  107.         call  tocolor
  108.         jc    no_color
  109.         .
  110.         .
  111.         .
  112.  
  113.  
  114. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  115.  
  116. TOMONO:      switches system to monochrome text mode; may be used either
  117.              to switch active monitors on a 2-monitor sysem or to switch
  118.              to monchrome text mode (80x25) from graphics mode (EGA or
  119.              Hercules).
  120. Source:      tocolor.asm ($6845.asm)
  121.  
  122. Call with:   no parameters
  123. Returns:     CF = 1 if no monochrome or InColor monitor
  124.              CF = 0 if successful
  125. Uses:        CF; all registers and all other flags are saved
  126. Example:
  127.  
  128. extrn   tomono:near
  129.  
  130. include codeseg.inc
  131.  
  132.         .
  133.         .
  134.         .
  135.         call  modemono
  136.         jc    no_mono
  137.         .
  138.         .
  139.         .
  140.  
  141.  
  142. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  143.  
  144. MODE43:      switch EGA to 80x43 text mode or VGA to 80x50 text mode
  145.              Mode43 switches an EGA to the 80-column, 43-row text mode from
  146.              any color mode or any EGA monochrome mode, or switches a color
  147.              VGA to 80x50 text mode from any other color mode.
  148. Source:      mode43.asm
  149.  
  150. Call with:   no parameters
  151. Returns:     if CF = 1, AX = 0 if no EGA or VGA in system
  152.                         AX = -1 if EGA connected to CGA monitor
  153.              if CF = 0, AX = 3 if EGA or VGA connected to color monitor
  154.                         AX = 7 if EGA or VGA connected to monochrome monitor
  155. Uses:        AX, CF; all other registers and flags are saved
  156. Example:     call  mode43
  157.              jc    noega
  158.  
  159.  
  160.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  161.  
  162. SVGA132:     set 132-column text mode on supported SEGA and SVGA systems
  163. Source:      svga132.asm ($sega.asm, $svga.asm)
  164.  
  165. Call with:   AX = mode number
  166.               0 = 25 rows
  167.               1 = 30 rows (approx)
  168.               2 = 43 rows (approx)
  169.               3 = 50 rows (SVGA only)
  170.               4 = 60 rows (SVGA only)
  171. Returns:     if CF = 0, no error
  172.              if CF = 1, mode not supported
  173. Uses:        flags
  174. Example:
  175.  
  176. include model.inc
  177.  
  178. public  set132mode
  179. extrn   svga132:near
  180.  
  181. include codeseg.inc
  182.  
  183. set132mode      proc near
  184.         mov    ax,4
  185. try_to_set_mode:
  186.         call    svga132
  187.         jnc     short all_done   ; all done if it worked
  188.         sub     ax,1             ;  else try next lower mode number
  189.         jnc     try_to_set_mode  ;  unless modes exhausted
  190.                                  ;  then exit with CF = 1
  191. all_done:
  192.         ret
  193.  
  194.  
  195.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  196.  
  197. SVGA16:      set Super VGA mode
  198. Source:      svga16.asm (banks.asm, $graph.asm)
  199.  
  200. Call with:   AX = 16-color mode desired
  201.              AX = 0 for 800x600
  202.              AX = 1 for 1024x768
  203.  
  204.              ASM32's SVGA subroutines are derived from John Bridges'
  205.              public domain VGAKIT board identification and bank switching code.
  206.              Boards supported are:
  207.  
  208.              Ahead Technologies
  209.              ATI
  210.              Chips & Technologies
  211.              Cirrus
  212.              Everex
  213.              Genoa GVGA
  214.              NCR
  215.              Oak Technologies
  216.              Paradise (Western Digital)
  217.              Trident
  218.              Trident 8900
  219.              Tseng (Genoa, Orchid, Willow)
  220.              Tseng 4000
  221.              VESA standard
  222.              Video 7
  223.  
  224.              I have not been able to test SVGA16 on all boards; please
  225.              let me know if you encounter difficulties.  Note that not
  226.              all modes are supported by all boards; be sure to check CF
  227.              after calling SVGA16.
  228.  
  229. Returns:     if CF = 0, AX = extended BIOS mode number
  230.              if CF = 1, requested mode is not available
  231.              SVGA16 cannot determine if the monitor you are using will
  232.              work with the requested mode.  Monitor damage may result
  233.              from improper use of SVGA16.
  234.  
  235. Example:
  236.  
  237. public mygraph
  238. extrn  svga16:near
  239.  
  240. include codeseg.inc
  241.  
  242. mygraph proc   near
  243. ; I want to use a 16-color 1024x768 mode if available
  244.         mov    ax,1             ; specify 1024x768 mode
  245.         call   svga16
  246.         jc     short no_svga
  247.  
  248.  
  249. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  250.  
  251. SVGA256:     set Super VGA 256-color mode
  252. Source:      svga256.asm (banks.asm)
  253.  
  254. Call with:   AX = 256-color mode desired
  255.              AX = 0 for  640x400
  256.              AX = 1 for  640x480
  257.              AX = 2 for  800x600
  258.              AX = 3 for 1024x768
  259.  
  260.              ASM32's SVGA256 subroutines are derived from John Bridges'
  261.              public domain VGAKIT board identification and bank switching code.
  262.  
  263.              Equipment supported is listed under SVGA16, plus:
  264.  
  265.              Compaq (640x480 only)
  266.  
  267.  
  268. Returns:     if CF = 0, AX = extended BIOS mode number
  269.              if CF = 1, requested mode is not available
  270.              SVGA256 cannot determine if the monitor you are using will
  271.              work with the requested mode.  Monitor damage may result
  272.              from improper use of SVGA256.
  273.  
  274. Example:     see SVGA16
  275.  
  276.  
  277.  
  278. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  279.  
  280. SVGA32k:     set Super VGA 32k-color mode
  281. Source:      svga32k.asm (banks.asm)
  282.  
  283. Call with:   AX = 32k-color mode desired
  284.              AX = 0 for  320x200
  285.              AX = 1 for  640x480
  286.              AX = 2 for  800x600
  287.              AX = 3 for 1024x768
  288.              AX = 4 for 1280x1024
  289.  
  290.              Equipment supported is:
  291.  
  292.              Trident 8900 (640x480, 800x600)
  293.              VESA
  294.  
  295.  
  296. Returns:     if CF = 0, AX = extended BIOS mode number
  297.              if CF = 1, requested mode is not available
  298.              SVGA32k cannot determine if the monitor you are using will
  299.              work with the requested mode.  Monitor damage may result
  300.              from improper use of SVGA32k.
  301.  
  302. Example:     see SVGA16
  303.  
  304. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  305.  
  306. VGA13X:      changes standard VGA systems to undocumented 256-color graphics
  307.              modes.  ASM32 graphics subroutines support 4 VGA13X modes
  308.              with up to 4 pages.  See also XModeClear.
  309.              VGA13X is derived from public domain code from John Bridges
  310.              and Themie Gouthas.
  311. Source:      vga13x.asm (crtc.13x, $graph.asm)
  312.  
  313. Call with:   AX = VGA13X mode number
  314.               0 = 320 x 200, 4 pages
  315.               1 = 320 x 240, 3 pages
  316.               2 = 320 x 400, 2 pages
  317.               3 = 360 x 480, 1 page
  318. Returns:     nothing
  319. Uses:        nothing
  320. Supports:    VGA or SVGA only: graphics mode
  321. Example:
  322.  
  323. extrn   vga13x:proc
  324.  
  325. include codeseg.inc
  326.         .
  327.         .
  328.         .
  329.         call   getcrt
  330.         cmp    al,3
  331.         jne    short oops            ; do something else if no VGA
  332.         mov    ax,2                  ; 320 x 400, 2 pages
  333.         call   vga13x
  334.  
  335.  
  336.  
  337. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  338.  
  339. XMODE16:     establish SuperEGA/SuperVGA graphics mode and configure
  340.              ASM32 graphics subroutines to work with the mode.
  341. XMODECLEAR:  restore ASM32's default graphics configuration
  342. Source:      xmode16.asm ($graph.asm)
  343.  
  344. Parameters:  maximum x, maximum y, registers as required to set mode.
  345.              XMode16 assumes that the mode is set with AH = 0.
  346. Returns:     nothing
  347. Uses:        All registers and flags saved.
  348. Supports:    16-color EGA/VGA-style graphics modes, up to 800 x 600 pixels.
  349.              Various equipment.  You must have the required equipment and
  350.              use the correct mode number;  hardware damage may result from
  351.              improper use of XMode16.  I cannot be held responsible for
  352.              damage resulting from use or misuse of XMode16.  Use XMode16
  353.              if your equipment is not supported by SVGA16.
  354.  
  355.              If 800 horizontal pixels are available, maxX% should be 799.
  356.              Similarly, if 600 vertical pixels are possible, maxY% should
  357.              be 599.
  358.  
  359.              Your graphics card manual lists mode numbers, monitor
  360.              requirements, and the number of horizontal and vertical
  361.              pixels corresponding to the mode.  Mode numbers are usually
  362.              in hex format.  Some modes and corresponding mode numbers
  363.              are listed on the next pages.
  364.  
  365.  
  366.  
  367.     Equipment            mode     mode number   Example
  368.  
  369.     Orchid ProDesigner   800x600        29h     mov   ax,799
  370.     STB EM/16                                   push  ax
  371.     Genoa                                       mov   ax,599
  372.     Sigma X16                                   push  ax
  373.     (Tseng chip set)                            mov   al,29h
  374.                                                 call  xmode16
  375.  
  376.  
  377.     Everex MED EGA       640X480   AL = 70h, BL = 00h
  378.     (Micro Enhancer Deluxe)
  379.                          752x410   AL = 70h, BL = 01h
  380.                                                 mov   ax,751
  381.                                                 push  ax
  382.                                                 mov   ax,409
  383.                                                 push  ax
  384.                                                 mov   al,70h
  385.                                                 mov   bl,01h
  386.                                                 call  xmode16
  387.  
  388.  
  389.     ATI VGA Wonder       800x600        54h     mov   ax,799
  390.                                                 push  ax
  391.                                                 mov   ax,599
  392.                                                 push  ax
  393.                                                 mov   al,54h
  394.                                                 call  xmode16
  395.  
  396.  
  397.     ATI VIP              800x560        53h     mov   ax,799
  398.                                                 push  ax
  399.                                                 mov   ax,559
  400.                                                 push  ax
  401.                                                 mov   al,53h
  402.                                                 call  xmode16
  403.  
  404. (continued)
  405.  
  406.     Paradise Plus-16     800x600        58h     mov   ax,799
  407.     Paradise Professional                       push  ax
  408.                                                 mov   ax,599
  409.                                                 push  ax
  410.                                                 mov   al,58h
  411.                                                 call  xmode16
  412.     
  413.  
  414.     Video 7 Fastwrite    800x600        62h     mov   ax,799
  415.     Video 7 VRAM                                push  ax
  416.                                                 mov   ax,599
  417.                                                 push  ax
  418.                                                 mov   al,62h
  419.                                                 call  xmode16
  420.  
  421.  
  422.     Western Digital      800x600   6Ah (color)  mov   ax,799
  423.                                    6Bh (mono)   push  ax
  424.     (VESA modes)                                mov   ax,599
  425.                                                 push  ax
  426.                                                 mov   al,6Ah   ; color
  427.                                                 call  xmode16
  428.     
  429.  
  430.     If any of this information conflicts with the specifications in your
  431.     video card's instruction manual, the manual's recommendation is a safer
  432.     bet.  Note that all the above modes require a multi-frequency monitor.
  433.  
  434.     When you're all done with Graphics mode, CALL ModeColor to return to
  435.     80x25 text mode, and CALL XModeClear to reset ASM32's graphics mode
  436.     flags.
  437.  
  438.  
  439.  
  440.